package com.qingcloud.base.feign.factory;


import com.qingcloud.base.feign.UserService;
import com.qingcloud.base.feign.fallback.UserServiceFallback;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserServiceFallbackFactory implements FallbackFactory<UserService> {
    @Override
    public UserService create(Throwable throwable) {
        UserServiceFallback fallback = new UserServiceFallback();
        fallback.setCause(throwable);
        return fallback;
    }
}
